<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="收货单作废" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doShow(id){
		var url="/cooper/GatherBillInfoForCancel.ihtm?id="+id;
		ShowIframe("收货单作废",url,900,500,"refreshWin()",900,600);
	}
	function refreshWin(){
		if(popRetVal!=null){
			window.location=window.location;
		}
	}
	function doDisabled(id){
		var url="/system/CancelReasonNew.ihtm?id="+id+"&cancel_type=gather";
		ShowIframe("收货单作废",url,900,300,"refreshWin()",900,600);
	}
	function doSearch(){
		var searchKey=encodeURIComponent(document.getElementById("search_key").value.trim());
		var tsId=document.getElementById("ts_id").value;
		window.location="/cooper/GatherBillListForCancel.ihtm?ts_id="+tsId+"&search_key="+searchKey;
	}
	function doGo(pageIndex){
		var searchKey=encodeURIComponent("${searchKey}");
		window.location="/cooper/GatherBillListForCancel.ihtm?ts_id=${tsId}&search_key="+searchKey+"&current_page="+pageIndex;
	}
	function doJump(pageIndex){
		if(window.event.keyCode==13){
			doGo(pageIndex);
		}
	}
	
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var str="";
		if(ob_arr.length>=it.getAttribute("index")){
			str=ob_arr[it.getAttribute("index")-1].value;
		}
		if(str==""){
			return;
		}
		doShow(str);
	}
	function doCancel(){
		window.close();
	}
	function doInit(){
		Window_Onload();
		document.getElementById("search_key").focus();
	}
	function checkSearchKey(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
</script>
</head>
<body oncontextmenu="return false" onLoad="doInit();"  class="sheet" style="text-align:center;">
<div class="sheet-main" style="width:860px;text-align:left;margin:auto;">
  <div class="sheet-top">
    <div class="content">
      <h2>收货单作废</h2>
      <p>收货单作废相当于删除操作，一旦作废，该收货单将不可以恢复</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
      <div class="content">
        <table width="748">
          <tbody>
            <tr>
              <td  align="right">
	              <input type="text" class="TextBox" id="search_key" name="search_key" onKeyUp="checkSearchKey();" style="width:100px" value="${searchKey}" title="允许以外协商名称、外协商拼音字头、收货单号、外协单号、收货单摘要进行模糊查询">
	              <select name='ts_id' id="ts_id">
					<option value="0">==请选择账套==</option>
					<c:forEach var="item" items="${tsList}">
					<option value="${item.id}" <c:if test="${tsId==item.id}">selected</c:if>>${item.title}</option>
					</c:forEach>
		  		  </select>
	              <input type="button" class="buttom search-but" value=" 查 询" onClick="doSearch();" title="允许以外协商名称、外协商拼音字头、收货单号、外协单号、收货单摘要进行模糊查询">
				</td>
            </tr>    
           </tbody>      
        </table>
      </div>
	  <%@include file="../inc/AlertMsg.jsp"%>
	  <div class="table-list">
        <table width="100%">      
 					<tr >	
						<th  width="14%">单号</th>
						<th  width="10%">收货日期</th>
						<th  width="16%">外协单位</th>
						<th  width="14%">外协单号</th>
						<th  width="14%">摘要</th>
						<th  width="8%">业务员</th>
						<th  width="8%">开单人</th>
						<th  width="8%">状态</th>
						<th  width="8%">操作</th>
					</tr>
				<c:forEach var="item" items="${qr.list}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
						<td>
							<input type="radio" name='query_checkbox' value="${item[0].id}" style="display:none">
							${item[0].billCode}
						</td>
						<td><fmt:formatDate value="${item[0].gatherDate}" pattern="yyyy-MM-dd"/></td>
						<td>${item[1].estName}</td>
						<td>${item[2]}</td>
						<td>${item[0].content}</td>
						<td>${item[3]}</td>
						<td>${item[0].createrName}</td>
						<td>
							<c:if test="${item[0].examined=='Y'}">已审核</c:if>
							<c:if test="${item[0].examined=='N'}">未审核</c:if>
						</td>
						<td>
							<a href="javascript:doDisabled('${item[0].id}');">作废</a>
							<a href="javascript:doShow('${item[0].id}');">查看</a>
						</td>
					</tr>
				</c:forEach>
			</table>
			<%@include file="../inc/Pages.jsp"%>
      </div>
    </div>
  </div>
</div>
</body>
</html>